<template>
  <div>
    <a-card :bordered="false">
      <a-tabs v-model="activeKey">
        <a-tab-pane tab="供电设备" key="1">
          <electric modelType="f010303" ref="electric" v-if="activeKey === '1'" />
        </a-tab-pane>

        <a-tab-pane tab="制冷设备" key="2">
          <air modelType="f010303" ref="air" v-if="activeKey === '2'" />
        </a-tab-pane>
      </a-tabs>
    </a-card>
  </div>
</template>

<script>
import Electric from "../f010302/modules/Electric";
import Air from "../f010302/modules/Air";
export default {
  name: "F010102",
  components: {
    Electric,
    Air,
  },
  data() {
    return {
      activeKey: '1'
    };
  },
  created() {},
  methods: {
    handleTabChange() {
      let key = this.activeKey;
      if (key === '1' && this.$refs.electric) {
        this.$refs.electric.loadData();
      } else if (key === '2' && this.$refs.air) {
        this.$refs.air.loadData();
      }
    },
  },
};
</script>